package com.runvp.service.auth.service;

import com.runvp.common.core.domain.AjaxResult;
import com.runvp.service.auth.domain.BizLoginLog;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

@Service
public class LoginLogService {



    /**
     * 插入登录日志
     *
     * @param username
     * @param status
     * @param message
     * @param ip
     */
    @Async
    public AjaxResult saveLogininfor(@RequestParam("username") String username, @RequestParam("status") String status,
                                          @RequestParam("message") String message, @RequestParam("ip") String ip) {
        BizLoginLog loginLog = new BizLoginLog();
        loginLog.setUserName(username);
        loginLog.setStatus(status);
        loginLog.setMsg(message);
        loginLog.setIpaddr(ip);
        add(loginLog);
        return AjaxResult.success(true);
    }

    /**
     * 登录日志记录
     */
    public void add(BizLoginLog loginLog) {
    }
}
